import React, { Component } from 'react'
import PropTypes from 'prop-types';

export default class User extends Component {
    static propTypes = {
    username:PropTypes.string,
    age:PropTypes.number,
    work:PropTypes.string.isRequired
    }
    static defaultProps = {
        work:'SISTER IS PRETTY'
    }
    render() {
            const {username , age, work} = this.props; 
        return (
            <ul>
                <li>用户名：{username}</li>
                <li>年龄：{age+1}</li>
                <li>代表作：{work}</li>
            </ul>
        )
    }
}
// User.propTypes = {
//     username:PropTypes.string,
//     age:PropTypes.number,
//     work:PropTypes.string.isRequired
// }
